#include<stdio.h>
#include<ctype.h>
#include<string.h>
int main()
{
    char s[1000];
    gets(s);
    int letter,number,space,other;
    letter=number=space=other=0;
    int i,len=strlen(s);
    for(i=0; i<len; i++)
        if(isalpha(s[i]))
            ++letter;
        else if(isdigit(s[i]))
            ++number;
        else if(isspace(s[i]))
            ++space;
        else
            ++other;
    printf("%d %d %d %d\n",letter,number,space,other);


    return 0;
}
